/*
 * PDLogger
 * 
 * Copyright (c) 2012, Zoujie Wu <yibn2008@gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 *   * Redistributions of source code must retain the above copyright notice, this 
 *     list of conditions and the following disclaimer.
 *   
 *   * Redistributions in binary form must reproduce the above copyright notice, 
 *     this list of conditions and the following disclaimer in the documentation 
 *     and/or other materials provided with the distribution.
 *   
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* $Id$ */

#ifndef PDL_RECORD_H
#define PDL_RECORD_H

/* define log record constants */
#define PDL_LABEL_DUMP		"Dump"
#define PDL_MSG_DUMP		"Dump debug data"
#define PDL_MSG_EXCEPTION	"Record exception"
#define PDL_FILE_UNKNOWN	"Unknown file"

/* define log record internal API */
PDL_API ulong pdl_record(int level, char *label, uint label_len, char *msg, uint msg_len, const char *call_file, uint line, zval *data TSRMLS_DC);

/* {{{ ARG_INFO
 */
ZEND_BEGIN_ARG_INFO_EX(pdl_info_arginfo, 0, 0, 2)
	ZEND_ARG_INFO(0, label)
	ZEND_ARG_INFO(0, msg)
	ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(pdl_warning_arginfo, 0, 0, 2)
	ZEND_ARG_INFO(0, label)
	ZEND_ARG_INFO(0, msg)
	ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(pdl_error_arginfo, 0, 0, 2)
	ZEND_ARG_INFO(0, label)
	ZEND_ARG_INFO(0, msg)
	ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(pdl_exception_arginfo, 0, 0, 2)
	ZEND_ARG_INFO(0, label)
	ZEND_ARG_OBJ_INFO(0, ex, Exception, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(pdl_dump_arginfo, 0)
	ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()
/* }}} */

/* define log record API */
PHP_FUNCTION(pdl_info);
PHP_FUNCTION(pdl_warning);
PHP_FUNCTION(pdl_error);
PHP_FUNCTION(pdl_exception);
PHP_FUNCTION(pdl_dump);

#endif	/* PDL_RECORD_H */

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */
